package com.zhz.common.utils;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.zhz.common.tool.mybatisplus.base.dal.utils.JsonUtils;

import java.io.IOException;
import java.util.Map;

/**
 * json工具类
 *
 * @author zhouhengzhe
 */
public class MapDeserializer extends JsonDeserializer<Map> {
    @Override
    public Map deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
        return JsonUtils.toDTO(jsonParser.getText(), Map.class);
    }
}